N = int(input())
X = int(input())
Y = int(input())

5 4 3
##1 2  3        4            5               6                       7
##N 25 80+20 320 + 80  (400-80)*4 + 320 （1600-320）*5         (6400-1280)*4
##N N*X +N SUM -N * X+1 100-20 * 5
##5 25 100 400 1600 6400

# 1 2 4
# 1 2    3   4 
  1 2+1  2*2 4    

1 2     3     4         5        6           7          8               9     10
N N+N*X 
1 1+3 4+12 16+48 (64-1)*(X+1)  (252-3)*3+249  996-12   3936-48 *4
1 4   16    64  252   996               3936
1 3 5
S = num
for i in range(1,Y):
        num = num + num * X

for i in range(Y,N+1):
        # Y 天之前的感染人数
        num = (num - S)*(X+1)
        S = S*X
print(num)
        



